package com.netease.b.b.a;

import com.netease.b.a.d;
import com.netease.b.b.e.f;
import com.netease.b.b.e.g;
import com.netease.b.b.e.k;
import com.netease.framework.a.m;
import com.netease.pris.a.i;
import com.netease.pris.c.l;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.json.JSONException;
import org.json.JSONObject;

public class a extends k
{
  private String a;
  private String b;
  private String j;
  private m k;

  protected a(int paramInt)
  {
    super(paramInt);
  }

  public static com.netease.framework.b.a a(String paramString1, String paramString2, String paramString3)
  {
    a locala = new a(4097);
    locala.a = paramString2;
    locala.b = paramString3;
    locala.j = paramString1;
    return locala;
  }

  private void a(String paramString1, String paramString2)
  {
    b.a().a(paramString1, paramString2);
  }

  private boolean a()
  {
    int i = 1;
    String[] arrayOfString = l.c(d.h().a(), this.j, 5);
    if ((arrayOfString != null) && (arrayOfString.length == 2) && (!i.e(arrayOfString[0])) && (!i.e(arrayOfString[i])))
      a(arrayOfString[0], arrayOfString[i]);
    while (true)
    {
      return i;
      i = 0;
    }
  }

  private m b()
  {
    String str = b.a().a("");
    ArrayList localArrayList = new ArrayList();
    if (!i.e(this.a))
      localArrayList.add(new com.netease.c.b.b("status", this.a));
    if (!i.e(this.b))
      localArrayList.add(new com.netease.c.b.b("place_id", this.b));
    b.a().a(localArrayList, "status.set");
    m localm = new m(str, com.netease.framework.a.b.b);
    try
    {
      UrlEncodedFormEntity localUrlEncodedFormEntity = new UrlEncodedFormEntity(localArrayList, "utf-8");
      localm.a(localUrlEncodedFormEntity);
      return localm;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      while (true)
      {
        localUnsupportedEncodingException.printStackTrace();
        localm = null;
      }
    }
  }

  private Object b(String paramString)
  {
    Object localObject = null;
    g localg = new g(5);
    try
    {
      int i = new JSONObject(paramString).optInt("result");
      if (i != 1)
      {
        localObject = b.a().b(paramString);
      }
      else
      {
        localg.a(String.valueOf(i));
        if ((localg == null) || (!i.e(localg.b())))
          localObject = localg;
      }
    }
    catch (JSONException localJSONException)
    {
      while (true)
      {
        localJSONException.printStackTrace();
        localg = null;
      }
    }
    return localObject;
  }

  public void a(int paramInt, String paramString)
  {
    f localf = b.a().b(paramString);
    d(localf.h, localf);
  }

  public void a(String paramString)
  {
    Object localObject;
    switch (n())
    {
    default:
      localObject = null;
      if (o())
        break;
      if (localObject != null)
        if ((localObject instanceof f))
          d(((f)localObject).h, localObject);
    case 4097:
    case 4098:
    }
    while (true)
    {
      return;
      com.netease.g.b.e("BlogTransaction", paramString);
      localObject = b(paramString);
      break;
      localObject = b(paramString);
      break;
      c(0, localObject);
      continue;
      d(-1, null);
    }
  }

  public void c()
  {
    if (!a())
    {
      d(-2, null);
      com.netease.g.b.d("***********", "Error  withou token & secret to send blog");
    }
    while (true)
    {
      return;
      switch (n())
      {
      default:
      case 4097:
      }
      while (true)
      {
        if ((this.k == null) || (o()))
          break label80;
        a(this.k);
        break;
        this.k = b();
      }
      label80: d(-4, null);
      h();
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.b.b.a.a
 * JD-Core Version:    0.6.0
 */